import { reqSingerList, reqSingerMessage } from "../../api";

const state = {
  singerList: {},
  singerMessage:{}
}

const mutations = {
  GETSINGERLIST (state, singerList) {
    state.singerList = singerList
  },
  GETSINGERMESSGAE (state, singerMessage) {
    state.singerMessage = singerMessage
  }
}

const actions = {
  async getSingerList ({ commit }) {
    let result = await reqSingerList()
    // console.log(result);
    if (result.code == 200) {
      commit('GETSINGERLIST', result.rows)
    }
  },
  async getSingerMessage ({ commit }, id) {
    let result = await reqSingerMessage(id)
    // console.log(result);
    if (result.code == 200) {
      commit('GETSINGERMESSGAE', result.object)
    }
  },
}
const getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}